package com.foreknow.elmboot.controller;

import com.foreknow.elmboot.mapper.BusinessMapper;
import com.foreknow.elmboot.po.Business;
import com.foreknow.elmboot.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
//@Controller  注释的这两个加一起等于@RestController，返回json数据
//@ResponseBody
@RequestMapping("/BusinessController")
public class BusinessController {
    @Autowired
    private BusinessService businessService;
    @RequestMapping("/listBusinessByOrderTypeId")
    public List<Business> business(Integer orderTypeId){
        List<Business> business = businessService.getBusinessByOrderTypeId(orderTypeId);
        return business;
    }

    @RequestMapping("/getBusinessById")
    public Business businessInfo(Integer businessId){
        Business business = businessService.getBusinessById(businessId);
        return business;
    }


}
